//
//  ViewController.m
//  加法计算器
//
//  Created by xjq on 16/2/21.
//  Copyright © 2016年 xjq. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

//数字1
@property (weak, nonatomic) IBOutlet UITextField *field1;
//数组2
@property (weak, nonatomic) IBOutlet UITextField *field2;
//结果
@property (weak, nonatomic) IBOutlet UILabel *sumLable;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)Dosome:(id)sender {
    int num1 = [self.field1.text intValue];
    int num2 = [self.field2.text intValue];
    int sum = num1 + num2;
    self.sumLable.text = [NSString stringWithFormat:@"%d",sum];
    [self.field1 resignFirstResponder];
    [self.field2 resignFirstResponder];
    //[self.view endEditing:YES];
}

@end
